package com.zjmzxfzhl.modules.purchase.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zjmzxfzhl.common.base.BaseService;
import com.zjmzxfzhl.modules.purchase.controller.dto.PurchaseFileQueryDto;
import com.zjmzxfzhl.modules.purchase.controller.vo.PurchaseFileVo;
import com.zjmzxfzhl.modules.purchase.entity.PurchaseFile;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * Service
 *
 * @author 庄金明
 */
public interface PurchaseFileService extends BaseService<PurchaseFile> {
    /**
     * 分页查询
     *
     * @param page
     * @param purchaseFile
     * @return
     */
    IPage<PurchaseFileVo> list(IPage<PurchaseFileVo> page, PurchaseFileQueryDto purchaseFile);

    /**
     * 上传文件
     *
     * @param multipartFile
     * @param purchaseFile
     */
    void uploadFile(MultipartFile multipartFile, PurchaseFile purchaseFile);

    /**
     * 删除文件
     *
     * @param fileIds
     */
    void deleteFiles(List<Long> fileIds);

    /**
     * 预览文件
     *
     * @param response
     * @param fileId
     */
    void readFile(HttpServletResponse response, Long fileId);

    /**
     * 下载文件
     *
     * @param response
     * @param fileId
     */
    void downloadFile(HttpServletResponse response, Long fileId);
}
